package net.models;

// Generated 27 mars 2014 09:40:52 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Sprint generated by hbm2java
 */
@Entity
@Table(name = "sprint", catalog = "scrumtool")
public class Sprint implements java.io.Serializable {

	private Integer id;
	private Product product;
	private String label;
	private Set<Event> events = new HashSet<Event>(0);
	private Set<Participate> participates = new HashSet<Participate>(0);
	private Set<Userstory> userstories = new HashSet<Userstory>(0);

	public Sprint() {
	}

	public Sprint(Product product) {
		this.product = product;
	}

	public Sprint(Product product, String label, Set<Event> events,
			Set<Participate> participates, Set<Userstory> userstories) {
		this.product = product;
		this.label = label;
		this.events = events;
		this.participates = participates;
		this.userstories = userstories;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idProduct", nullable = false)
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "label", length = 100)
	public String getLabel() {
		return this.label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sprint")
	public Set<Event> getEvents() {
		return this.events;
	}

	public void setEvents(Set<Event> events) {
		this.events = events;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sprint")
	public Set<Participate> getParticipates() {
		return this.participates;
	}

	public void setParticipates(Set<Participate> participates) {
		this.participates = participates;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sprint")
	public Set<Userstory> getUserstories() {
		return this.userstories;
	}

	public void setUserstories(Set<Userstory> userstories) {
		this.userstories = userstories;
	}

}
